__________________________________________________________________________________________________
class Solution:
    def calculateTime(self, keyboard: str, word: str) -> int:
        pos = 0
        ans = 0
        for ch in word:
            cur = keyboard.find(ch)
            ans += abs(cur - pos)
            pos = cur
        return ans
__________________________________________________________________________________________________

__________________________________________________________________________________________________
